package com.prs.crm.domain.cdxh;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.BaseEntity;

/**
 * @author LanXiaoGang
 * @E-mail:lan9liang@163.com
 * @qq:7857553326
 * @version 创建时间：2010-12-9 上午09:52:56 简单说明
 */
@Entity
@Table(name = "cdxh_DistributionOrder")
public class DistributionOrder extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	/**
	 * 配送单明细
	 */
	@OneToMany(mappedBy = "distributionOrder")
	@Cascade({ org.hibernate.annotations.CascadeType.ALL,
			org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
	private Set<DistributionOrderDetail> details;
     
	/**
	 * 订单编号
	 */
	private String disOrderCode;
	/**
	 * 客户名称
	 */
	private String disOrderCustomer;
	
	/**
	 * 配送单编号
	 */
	private String distributionCode;
	
	/**
	 * 配送时间
	 */
	private String disOrderDate;
	/**
	 * 合计总数量
	 * 
	 */
	@Column(columnDefinition = "Integer(11) default '0'")
	private int disTotalNums;

	/**
	 * 合计总金额
	 */
	@Column(columnDefinition = "Double(11,3) default '0.000'")
	private Double disTotalMoney;
	/**
	 * 客户签名
	 */
	private String disCustomerq;
	/**
	 * 仓管
	 */
	private String disStockPerson;
	/**
	 * 配送人
	 */
	private String disPerson;
	/**
	 * 制表人
	 */
	private String disTablePerson;
	/**
	 * 备注
	 */
	@Lob
	private String disRemark;

	/**
	 * 显示
	 * 大于7则不显示
	 */

	private String state;
	
	
	public void addDetail(DistributionOrderDetail detail) {
		if (details == null)
			details = new HashSet<DistributionOrderDetail>();
		detail.setDistributionOrder(this);
		details.add(detail);
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Set<DistributionOrderDetail> getDetails() {
		return details;
	}

	public void setDetails(Set<DistributionOrderDetail> details) {
		this.details = details;
	}

	public String getDisOrderCode() {
		return disOrderCode;
	}

	public void setDisOrderCode(String disOrderCode) {
		this.disOrderCode = disOrderCode;
	}

	public String getDisOrderCustomer() {
		return disOrderCustomer;
	}

	public void setDisOrderCustomer(String disOrderCustomer) {
		this.disOrderCustomer = disOrderCustomer;
	}

	public String getDisOrderDate() {
		return disOrderDate;
	}

	public void setDisOrderDate(String disOrderDate) {
		this.disOrderDate = disOrderDate;
	}

	public int getDisTotalNums() {
		return disTotalNums;
	}

	public void setDisTotalNums(int disTotalNums) {
		this.disTotalNums = disTotalNums;
	}

	public Double getDisTotalMoney() {
		return disTotalMoney;
	}

	public void setDisTotalMoney(Double disTotalMoney) {
		this.disTotalMoney = disTotalMoney;
	}

	public String getDisCustomerq() {
		return disCustomerq;
	}

	public void setDisCustomerq(String disCustomerq) {
		this.disCustomerq = disCustomerq;
	}

	public String getDisStockPerson() {
		return disStockPerson;
	}

	public void setDisStockPerson(String disStockPerson) {
		this.disStockPerson = disStockPerson;
	}

	public String getDisPerson() {
		return disPerson;
	}

	public void setDisPerson(String disPerson) {
		this.disPerson = disPerson;
	}

	public String getDisTablePerson() {
		return disTablePerson;
	}

	public void setDisTablePerson(String disTablePerson) {
		this.disTablePerson = disTablePerson;
	}

	public String getDisRemark() {
		return disRemark;
	}

	public void setDisRemark(String disRemark) {
		this.disRemark = disRemark;
	}

	public String getDistributionCode() {
		return distributionCode;
	}

	public void setDistributionCode(String distributionCode) {
		this.distributionCode = distributionCode;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	


}
